<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>首页</title>
<link href="<?php echo $this->_webroot('/style/jq-ui/jquery-ui-1.8.18.custom.css'); ?>" rel="stylesheet" type="text/css">
<link href="<?php echo $this->_webroot('/style/css.css'); ?>" rel="stylesheet" type="text/css">
<link href="<?php echo $this->_webroot('/style/content.css'); ?>" rel="stylesheet" type="text/css">
<style>
.leftMenu li .arrow1 {
    background: none;
}
</style>
<script language="JavaScript">
<!--
function changImg(id){
document.getElementById(id).src ='<?php echo $this->_url('user/kcaptcha') .'?'; ?>'+Math.random(1);
}
//-->
</script>
<script type="text/javascript" src="<?php echo $this->_webroot('/script/jquery-1.7.1.min.js'); ?>"></script>
<script type="text/javascript" src="<?php echo $this->_webroot('/script/jquery-ui-1.8.18.custom.min.js'); ?>"></script>
<script type="text/javascript" src="<?php echo $this->_webroot('/script/jquery.carouFredSel-5.5.0-packed.js'); ?>"></script>
<script type="text/javascript" src="<?php echo $this->_webroot('/script/js.js'); ?>"></script>
<script type="text/javascript" src="<?php echo $this->_webroot('script/content.js'); ?>"></script>
</head>
<body>
<psp:tags     htmlname='divstart'  iconname='divstart' />
<psp:tags     htmlname='default_topnav'  iconname='defaulttopnav' />
<div class="head">
    <psp:tags     htmlname='default_index_logobox'  iconname='default_index_logobox' />
	
 <?php
    $cityid = $this->controller->C_session->read('_user_city_id');
	$cityname = '全国';
	if($cityid) {
        $this->controller->loadModel('area');
	    $array = $this->controller->area->find('first', array('conditions' =>array('area.id' =>$cityid )));
		if($array) {
		    $cityname = $array['area']['area_name'];
		}	    
	}	
?>    
    <div class="exchangeArea">
    	<a href="#">【<span class="fontRed"><?php echo $cityname; ?></span>】<br /><span class="divcityqiehuang fontDust" rel="<?php echo $this->_url('default/city/');?>">更换城市</span></a>		
    </div>	
	
<div id="div_city_qiehuang" style="display:none;left: 10px;position: relative;top: 50px;z-index: 1005;background-color: #666;padding: 10px;">
    <div  class="div_city_qiehuangClose"  style="cursor: pointer;position: absolute;right: 20px;top: 10px;"><img src="<?php echo $this->_webroot('images/loginDialogClose.jpg'); ?>"  /></div>
    <iframe  id="div_city_qiehuang1" width="965" height="786" style="border:1px solid #ccc;"></iframe>
</div>
<script>
jQuery(function($){
$(".divcityqiehuang").click(function(){
	var url = $(this).attr("rel");
	$("#div_city_qiehuang1").attr("src",url);	
	$("#div_city_qiehuang").dialog({width:1000,height:860,modal: true});
})
$(".div_city_qiehuangClose").click(function(){
    $("#div_city_qiehuang").dialog( "close" );
})
   }
)
</script>	
	
<script language="JavaScript">	
jQuery(function($){
$('.selecttype').click( function() {
  $('#searchkeyForm').attr('action',$(this).attr('href'));
});	
});
</script> 
    <div class="search-box">
    	<div class="switch-nav-box">
            <ul class="switch-nav">
                <li class="on"><div class="switch-nav-item"><div class="switch-nav-left"><div class="switch-nav-right"><a href="<?php echo $this->_url('default/productlist/');?>" class="selecttype" >商品</a></div></div></div></li>
                <li><div class="switch-nav-item"><div class="switch-nav-left"><div class="switch-nav-right"><a href="<?php echo $this->_url('default/productlist/brand/');?>"  class="selecttype" >品牌</a></div></div></div></li>
                <li><div class="switch-nav-item"><div class="switch-nav-left"><div class="switch-nav-right"><a href="<?php echo $this->_url('default/shop/');?>" class="selecttype" >商家</a></div></div></div></li>
            </ul>
            <div class="clear"></div>
        </div>
        <div class="search-w-bg">
        	<div class="searchForm">
            	<form action="<?php echo $this->_url('default/productlist/');?>" method="get" id="searchkeyForm" class="searchkeyForm" name="searchkeyForm" >
            	<input type="text" class="searchInput" name="k"  />
                <input type="submit" class="searchBtn" value="爱搜货"  />
                </form>
            </div>
            <div class="adsearch">
            	<a href="<?php echo $this->_url('default/productlist/');?>">高级搜索</a><br />
                <a href="<?php echo $this->_url('article/index/?id=3');?>">使用帮助</a>
            </div>
            <div class="clear"></div>
        </div>
		<psp:tags     htmlname='default_index_searchworld'  iconname='default_index_searchworld' />

    </div>
    <div class="clear"></div>
</div>

<psp:tags     htmlname='default_navlist'  iconname='default_navlist' />

<div class="container">
	<div class="mod1">
    	<div class="leftMenuBox">
        	<ul class="leftMenu">
		    <?php 
			$this->controller->loadModel('brandgoodscategories');
			$this->controller->loadModel('brand');			
			?>
            <?php $i=0;  foreach(array_slice ($CATEGORY[0], 0) as $key=>$cat){ $i++; ?>				
            	<li class="<?php if ($i==1) { ?>first <?php } ?>leftMenuLi">
                	<div class="item">
                        <a href="#" class="leftMenuItem">
                            <div class="leftMenuLeft"><?php echo  $cat['cat_name'];?></div><div class="leftMenuRight"><?php echo  $cat['content'];?></div>
                        </a>
                        <b class="pointer"></b>
                    </div>
			        <?php $count1 = 0;  if(isset($CATEGORY[$cat['id']]) && $CATEGORY[$cat['id']]){?>
				        <?php  foreach(array_slice ($CATEGORY[$cat['id']], 0) as $subcat){  $count1 ++ ;  ?> 					
					    <?php }?>
				    <?php }?> 
                    <?php  $count2 = round($count1 / 2 );?>					
                    <div class="leftMenuCat">
                    	<div class="catLeft">
			            <?php if(isset($CATEGORY[$cat['id']]) && $CATEGORY[$cat['id']]){?>
				            <?php $count3=0; foreach(array_slice ($CATEGORY[$cat['id']], 0) as $subcat){  $count3++;  if($count3>$count2)break; ?> 						
                        	<div class="catItem">
                            	<h3><a href="<?php echo $this->_url('default/productlist1/');?>?id=<?php echo  $subcat['id'];?>&k=<?php echo  $k;?>" title="<?php echo  $subcat['cat_name'];?>"><?php echo  $subcat['cat_name'];?></a></h3>
			                    <?php if(isset($CATEGORY[$subcat['id']]) && $CATEGORY[$subcat['id']]){?>
				                    <?php  foreach(array_slice ($CATEGORY[$subcat['id']], 0) as $subcat1){?> 
				                        <a href="<?php echo $this->_url('default/productlist1/');?>?id=<?php echo  $subcat1['id'];?>&k=<?php echo  $k;?>" title="<?php echo  $subcat1['cat_name'];?>" style="color:#000;"><?php echo  $subcat1['cat_name'];?>:</a> 
			                            <?php if(isset($CATEGORY[$subcat1['id']]) && $CATEGORY[$subcat1['id']]){?>
				                            <?php  foreach(array_slice ($CATEGORY[$subcat1['id']], 0) as $subcat2){?> 					                
									        <a href="<?php echo $this->_url('default/productlist1/');?>?id=<?php echo  $subcat2['id'];?>&k=<?php echo  $k;?>" title="<?php echo  $subcat2['cat_name'];?>"><?php echo  $subcat2['cat_name'];?></a>
										    <?php }?>
				                        <?php }?>	
                                        <br/>										
									<?php }?>
				                <?php }?> 
                            </div>
					        <?php }?>
				        <?php }?> 							
							
							
                        </div>					
                        <div class="catRight">
			            <?php if(isset($CATEGORY[$cat['id']]) && $CATEGORY[$cat['id']]){?>
				            <?php $count3=0; foreach(array_slice ($CATEGORY[$cat['id']], 0) as $subcat){ $count3++;  if($count3<=($count2))continue;  ?> 						
                        	<div class="catItem">
                            	<h3><a href="<?php echo $this->_url('default/productlist1/');?>?id=<?php echo  $subcat['id'];?>&k=<?php echo  $k;?>" title="<?php echo  $subcat['cat_name'];?>"><?php echo  $subcat['cat_name'];?></a></h3>
			                    <?php if(isset($CATEGORY[$subcat['id']]) && $CATEGORY[$subcat['id']]){?>
				                    <?php  foreach(array_slice ($CATEGORY[$subcat['id']], 0) as $subcat1){?> 
				                        <a href="<?php echo $this->_url('default/productlist1/');?>?id=<?php echo  $subcat1['id'];?>&k=<?php echo  $k;?>" title="<?php echo  $subcat1['cat_name'];?>" style="color:#000;"><?php echo  $subcat1['cat_name'];?>:</a> 
			                            <?php if(isset($CATEGORY[$subcat1['id']]) && $CATEGORY[$subcat1['id']]){?>
				                            <?php  foreach(array_slice ($CATEGORY[$subcat1['id']], 0) as $subcat2){?> 					                
									        <a href="<?php echo $this->_url('default/productlist1/');?>?id=<?php echo  $subcat2['id'];?>&k=<?php echo  $k;?>" title="<?php echo  $subcat2['cat_name'];?>"><?php echo  $subcat2['cat_name'];?></a>
										    <?php }?>
				                        <?php }?>
                                        <br/>										
									<?php }?>
				                <?php }?> 
                            </div>
					        <?php }?>
				        <?php }?> 	
                        </div>
                    </div>
                </li>
            <?php }?>	

                <li class="last"><a href="<?php echo $this->_url('default/productlist/');?>" class="more">更多商品>></a></li>
            </ul>
            <div class="clear"></div>
        </div>
        
        <div class="scroll-boxs">		
		    <psp:tags     htmlname='default_index_slide'  iconname='default_index_slide' />
		    <psp:tags     htmlname='default_index_scroll'  iconname='default_index_scroll' />
        </div>
        
        <div class="sidebar">
		    <psp:tags     htmlname='default_index_loginbox'  iconname='default_index_loginbox' /> 
			
            <div class="trends">
            	<div class="hd">
                	<div class="left"><psp:tags labels='最新动态' iconname='defaultindex_lang_zuixing' /></div><div class="right"><a href="#">+更多</a></div>
                </div>
                <psp:tags     htmlname='default_index_news'  iconname='defaultindex_news' />
            </div>
        </div>
    </div>
	
    <psp:tags     htmlname='default_index_ad1'  iconname='defaultindex_ad1' />
    
    <div class="mod2">
    	<div class="category-box">
        	<div class="category-hd">
            	<div class="category-tab">
                	<ul class="mian-category-tab">
                    	<li class="selected"><div class="left-bg"><div class="right-bg">所属行业</div></div></li>
                        <li><div class="left-bg"><div class="right-bg">同城知名商圈</div></div></li>
                    </ul>
                </div>
                <div class="select-area">
                	<select name="">
                    	<option value="0">选择地区</option>
                    </select>
                </div>
            </div>
			
            <psp:tags     htmlname='default_index_shopcat'  iconname='default_index_shopcat' /> 			
            <psp:tags     htmlname='default_index_citycat'  iconname='default_index_citycat' />            
			
            <div class="clear"></div>
        </div>  		
        <div class="sidebar">
            <div class="guide-box">
            	<div class="hd2">
                	<ul class="guide-box-tab">
                    	<li class="selected"><div class="guide-left-bg"><div class="guide-right-bg">新手上路</div></div></li>
                        <li><div class="guide-left-bg"><div class="guide-right-bg">价格行情</div></div></li>
                        <li><div class="guide-left-bg"><div class="guide-right-bg">导购画报</div></div></li>
                    </ul>
                </div>
                
                <psp:tags     htmlname='default_index_guide1'  iconname='default_index_guide1' /> 
                <psp:tags     htmlname='default_index_guide2'  iconname='default_index_guide2' />                 
                <psp:tags     htmlname='default_index_guide3'  iconname='default_index_guide3' />
                
                <div class="clear"></div>
            </div>
            <psp:tags     htmlname='default_index_activity'  iconname='default_index_activity' />			

        </div>
        <div class="clear"></div>
    </div>    
    <psp:tags     htmlname='default_index_ad2'  iconname='default_index_ad2' />
    
    <psp:tags     htmlname='default_index_mod1'  iconname='default_index_mod1' />
    <psp:tags     htmlname='default_index_mod2'  iconname='default_index_mod2' /> 
	
</div>
<psp:tags     htmlname='default_footer'  iconname='defaultfooter' />

</body>
</html>